import React, { useState, useEffect } from 'react'
import { Button, SearchBar, Space,Swiper, Toast,Ellipsis,NavBar} from 'antd-mobile'
import { SearchOutline, SetOutline } from 'antd-mobile-icons'
import { Refresh } from '@nutui/icons-react'
import { BackTop, Cell } from '@nutui/nutui-react'
import '@nutui/nutui-react/dist/style.css'
import '../css/Main.css'
import ButtomBar from '../../sjc/components/ButtomBar'
import axios from 'axios'
import { Navigate } from 'react-router-dom'
export default function Send() {
    const nav = Navigate()
    const back = () =>{
        nav(-1)
    }
    let [ls, setls] = useState(JSON.parse(localStorage.getItem('searchname'))||[])
  return (
    <div>
      <NavBar onBack={back} style={{
                    '--height': '46px',
                    '--border-bottom': '2px #ccc solid',
                    position:'fixed',
                    top:'0',
                    width:'100%',
                    background:'#eae9e5'
                  }}><span style={{fontSize:'20px',color:'#f0d5b8',fontWeight:'bolder'}}>搜索结果</span></NavBar>
        <div style={{width:'100%',height:'46px'}}></div>
        <div style={{width:'100%',height:'100vh',background:'#e2e1df',overflow:'scroll'}}>
        {ls.map(i=>{
                return <div key={i._id} style={{width:'45%',height:'230px',border:'1px solid #ccc',
                background:'white',float:'left',margin:'8px',borderRadius:'6px',boxShadow:'0px 0px 4px #000'}}>
                  <img src={i.img[0]} style={{width:'100%',height:'150px',borderRadius:'6px'}}/>
                  <div style={{width:'90%',margin:'auto'}}>
                    <Ellipsis direction='end' rows={2} content={i.name} />
                  <div style={{width:'60px',height:'14px',borderTop:'1px solid #ccc',float:'left',
                  borderLeft:'1px solid #ccc',borderBottom:'1px solid #ccc',borderRight:'1px dashed #ccc'}}>
                    <span style={{fontSize:'1px',color:'#8e7e6f'}}>满300减30</span>
                  </div>  
                  <div style={{width:'50px',height:'14px',borderTop:'1px solid #ccc',float:'left',
                  borderLeft:'1px dashed #ccc',borderBottom:'1px solid #ccc',borderRight:'1px solid #ccc'}}>
                    <span style={{fontSize:'1px',color:'#8e7e6f'}}>店铺领劵</span>
                  </div>
                  <span style={{fontSize:'14px',fontWeight:'1000'}}>￥{i.price}</span>
                  </div>
                   
                </div>
              })}
        </div>
    </div>
  )
}
